*** LIS Cross-section Data center in Luxembourg

* email: usersupport@lisdatacenter.org 

*** LIS Self Teaching Package 2022
*** Part II: Gender, employment, and wages
*** Stata version

* last change of this version of the syntax: 15-01-2022.


** Exercise 3: Family structure and employment

global varshh "hid own"
global varspp "hid dname pwgt ppopwgt relation partner ageyoch age sex immigr educ educ_c emp status1 ptime1 hwage1"
global datasets "us04 be04 gr04"

program define make_data
foreach ccyy in $datasets {
use $varspp using $`ccyy'p, clear
merge m:1 hid using $`ccyy'h, keepusing($varshh)
keep if inrange(age,25,54) & relation<=2200
if "`ccyy'" != "us04" {
append using ${mydata}exercise2_LIS
}
save ${mydata}exercise2_LIS, replace
}
end

program define recode_data
recode ageyoch (. 18/max= 0 "no children <18") (0/5 = 1 "<6 years") (6/17 = 2 "6-17 years"), gen(achildcat)
label var achildcat "Lowest age of own children"
end

program define get_descriptives
table dname achildcat partner [aw=ppopwgt] if sex==2, contents(mean emp) format(%9.3f)
end

* Quietly make_data
use ${mydata}exercise2_LIS, clear
quietly recode_data
get_descriptives
